Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add grid movement and resizing functions #64

Merged
merged 8 commits into from
Nov 12, 2019
Merged

Add grid movement and resizing functions #64

merged 8 commits into from
Nov 12, 2019

Conversation

mtreca
Copy link
Contributor

@mtreca mtreca commented Oct 21, 2019

I would like to reopen PR #57.

It has been a year since I closed the original PR since the two grid-based operations I proposed could be implemented outside of windowchef with the help of wmutils, and it seemed good enough for me at the time.

After a year of using different window managers, namely windowchef, mwm (my fork of windowchef), fvwm, wmutils, cwm, awesome, qtile and bspwm, I am still struggling to settle on a wm for good mainly because none of these wms have grid operations baked-in by default. I considered several other options before opening this PR:

  • I could continue to maintain and use my windowchef fork, but I'd rather use and contribute to windowchef directly than working on a wm that only I am going to use.
  • I could also go the wmutils way as I did at first, but I would rather not have additional dependencies and depend on a shell script that is going to be approximately the same size as this PR (doc excluded).
  • I could go the program-your-own-wm route with awesome, but it lacks orthogonality and is somewhat contrived to setup.

Since neither of these options seem to cut it, I would like to merge these two functions to windowchef's core. I have other cool grid operations in mind that could be easily be implemented if this PR is merged (notably increasing and decreasing grid size on all four sides simultaneously).

Of course I would like to know what other windowchef users think of these changes and if they would be interested in using these kind of operations. If no one is really interested I think I will stick with maintaining my own branch.

@tudurom
Copy link
Owner

tudurom commented Oct 28, 2019

This PR and its intentions look quite good to me. I have only one question: how do you set the width and height of the grid?

@mtreca
Copy link
Contributor Author

mtreca commented Oct 29, 2019 via email

Copy link
Owner

@tudurom tudurom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the only remaining this is to remove the grid state when the window is altered (i.e. ungridding it in unmaximize_window).

man/waitron.1 Outdated Show resolved Hide resolved
wm.c Outdated Show resolved Hide resolved
These two functions respectively move and resize windows that were
previously put in a grid using window_put_in_grid.
A grid struct is added to clients to save the current client
position in the grid.
These name changes reflect the fact that a gridded window is special
but not maximized.
A window should not be rest if it is not special to begin with
@mtreca
Copy link
Contributor Author

mtreca commented Nov 7, 2019

Done!

@tudurom
Copy link
Owner

tudurom commented Nov 8, 2019

Looks great! One last question: what happens to the gridded windows if you change the parameters of the grid?

@mtreca
Copy link
Contributor Author

mtreca commented Nov 10, 2019

Do you mean if a window is in a 9x9 grid and it is changed to another value (eg. 5x5)? Then it should simply redraw the window in the new grid given that grid parameter can only be changed by put_window_in_grid.

@tudurom
Copy link
Owner

tudurom commented Nov 12, 2019

Looks legit then.

@tudurom tudurom merged commit 8d9eb9c into tudurom:master Nov 12, 2019
@tudurom
Copy link
Owner

tudurom commented Nov 12, 2019

@Vxid I made this fix too: 059c4f9

@mtreca
Copy link
Contributor Author

mtreca commented Nov 12, 2019

@tudurom Nice catch. I never monocle or maximize windows so I didn't test these cases properly.

@tudurom
Copy link
Owner

tudurom commented Nov 12, 2019

it's not about monocling or maximizing, but just moving or resizing the window normally while in grid state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants